home *** CD-ROM | disk | FTP | other *** search
- Path: wmin.ac.uk!usenet
- From: Idoia Lertxundi <gsoec@wmin.ac.uk>
- Newsgroups: comp.lang.c
- Subject: Text file for linked list (structures)
- Date: 29 Feb 1996 16:57:12 GMT
- Organization: Westminster University
- Message-ID: <4h4lt8$7eu@badger.wmin.ac.uk>
- References: <4h0j5t$7h9@newshost.vvm.com>
- NNTP-Posting-Host: ux1.wmin.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.3_U1 sun4c)
- X-URL: news:4h0j5t$7h9@newshost.vvm.com
-
- I have nested structures with pointers between them such as the one below.
-
- My question can someone recommend me the best way to open a text(data) file to
- feed to the following structures. All courses first, frames and how the
- prerequisites (prereq) bit?
-
- Shall I use fgets to read a line at the time or shall I read character by
- character fgetc?
-
- I would appreciate any help. Thank you all.
-
- typedef struct module
- {
- char code[8];
- char name[25];
- char result[10];
- struct module *nextm;
- struct module *prereq;
- struct module *coreq;
- }MODULE;
-
- typedef struct frame
- {
- char semester[4];
- char level[3];
- int freeelective;
- struct module *cormods;
- struct module *optmods;
- struct frame *nextf;
- }FRAME;
-
- <A HREF="mailto:gsoec@wmin.ac.uk">gsoec@wmin.ac.uk</A>
- <A HREF="http://www.wmin.ac.uk/~gsoec/">home page</A>
-
-